package charles.testproject.regex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexTester {

	public static void main(String[] args) {
//		String str="ejfejfo<br>cst " + "\n" + "&nbsp";
//      String regEx="[0-9][am|pm]";   
//      Pattern p=Pattern.compile(regEx);
//      Matcher m=p.matcher(str);
//      boolean result=m.find();
//      System.out.println(result);
		
		//(\\d+)为分组  
		String regex = "#&(\\d+)&#";  
		String str1 = "#&123&#  #&344&# 7878";  
		Pattern p = Pattern.compile(regex);  
		Matcher m = p.matcher(str1);  
		while(m.find()) {  
		System.out.println(">>>>>"+m.group(1));
		}
	}
}
